import Qs from 'qs';
import axios from './axios';
const devServer = {
    projectApiSystem: '/projectApi/juggle-systemplat',
    projectApiSmartpark: '/projectApi/juggle-smartparkplat'
    // projectApiSystem: 'https://wuc.irunway.cn/projectApi/juggle-systemplat',
    // projectApiSmartpark: 'https://wuc.irunway.cn/projectApi/juggle-smartparkplat'
}

const interfaces = {
    // 字典
	dictionary:(option,param)=>{
	    return axios[option.method](`${devServer.projectApiSystem}/api/system/dictionary/${option.type}.json`,Qs.stringify(param))
    },
    // 用户
    user:(option,param)=>{
        return axios[option.method](`${devServer.projectApiSystem}/api/system/user/${option.type}.json`,Qs.stringify(param,{ indices: false }))
    },
    // 普通登录
    login: (param) => {
        return axios.post(`${devServer.projectApiSystem}/auth/login.json`, Qs.stringify(param));
    },
    // 钉钉登录
    ddLogin: (param) => {
        return axios.post(`${devServer.projectApiSystem}/auth/ddLogin.json`, Qs.stringify(param));
    },
    // 钉钉鉴权
    ddjq:(param)=>{
        return axios.post(`${devServer.projectApiSmartpark}/dd/ddjq.json`, Qs.stringify(param));
    },
    //网格员
	gridMember:(option,param)=>{
	    return axios[option.method](`${devServer.projectApiSmartpark}/api/park/gridMember/${option.type}.json`,Qs.stringify(param,{indices:false }))
    },
    //企业信息
    enterprise: (option, param) => {
        return axios[option.method](`${devServer.projectApiSmartpark}/api/park/enterprise/${option.type}.json`, Qs.stringify(param, { indices: false }))
    },
    //发票信息
    settlement: (option, param) => {
        return axios[option.method](`${devServer.projectApiSmartpark}/api/park/settlement/${option.type}.json`, Qs.stringify(param, { indices: false }))
    },
    //人员信息
    personnel: (option, param) => {
        return axios[option.method](`${devServer.projectApiSmartpark}/api/park/personnel/${option.type}.json`, Qs.stringify(param, { indices: false }))
    },
    //用能信息
    revenue: (option, param) => {
        return axios[option.method](`${devServer.projectApiSmartpark}/api/enterprise/revenue/${option.type}.json`, Qs.stringify(param, { indices: false }))
    },
    //入驻信息
	spatialEnterprise:(option,param)=>{
	    return axios[option.method](`${devServer.projectApiSmartpark}/api/enterprise/spatialEnterprise/${option.type}.json`,Qs.stringify(param,{indices:false }))
	},
    //走访记录
    record: (option, param) => {
        return axios[option.method](`${devServer.projectApiSmartpark}/api/park/record/${option.type}.json`, Qs.stringify(param, { indices: false }))
    },
    //问题库
    problemBase: (option, param) => {
        return axios[option.method](`${devServer.projectApiSmartpark}/api/park/problemBase/${option.type}.json`, Qs.stringify(param, { indices: false }))
    },
    //问题处置结果
    disposalResults: (option, param) => {
        return axios[option.method](`${devServer.projectApiSmartpark}/api/park/disposalResults/${option.type}.json`, Qs.stringify(param, { indices: false }))
    },
    //政策文件
    policyReview: (option, param) => {
        return axios[option.method](`${devServer.projectApiSmartpark}/api/others/policyReview/${option.type}.json`, Qs.stringify(param, { indices: false }))
    },
    //经济指标图表
    chartsApi: (option,param) => {
        return axios.post(`${devServer.projectApiSmartpark}/statistics/park/economy/${option.type}.json`, Qs.stringify(param, { indices: false }))
    },
    // 企业图表
    enterpriseChartsApi: (option,param) => {
        return axios.post(`${devServer.projectApiSmartpark}/statistics/park/aboutEnterprise/${option.type}.json`, Qs.stringify(param, { indices: false }))
    },
    // 预警图表
    warnChartsApi: (option,param) => {
        return axios.post(`${devServer.projectApiSmartpark}/statistics/park/earlyWarnings/${option.type}.json`, Qs.stringify(param, { indices: false }))
    },
    // 走访图表
    interviewApi: (option,param) => {
        return axios.post(`${devServer.projectApiSmartpark}/statistics/park/interview/${option.type}.json`, Qs.stringify(param, { indices: false }))
    },
    // 移动端图表
    appChartsApi: (option,param) => {
        return axios.post(`${devServer.projectApiSmartpark}/statistics/park/app/${option.type}.json`, Qs.stringify(param, { indices: false }))
    },
}

export default interfaces